home *** CD-ROM | disk | FTP | other *** search
/ Programmers Heaven 2 / Programmers Heaven 2.iso / files / windows / ocx / ipack.exe / FINGERS.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1996-09-02  |  11.1 KB  |  347 lines

  1. VERSION 4.00
  2. Begin VB.Form frmFinger 
  3.    Caption         =   "Finger Sample Program"
  4.    ClientHeight    =   5565
  5.    ClientLeft      =   915
  6.    ClientTop       =   1905
  7.    ClientWidth     =   10215
  8.    BeginProperty Font 
  9.       name            =   "MS Sans Serif"
  10.       charset         =   0
  11.       weight          =   700
  12.       size            =   8.25
  13.       underline       =   0   'False
  14.       italic          =   0   'False
  15.       strikethrough   =   0   'False
  16.    EndProperty
  17.    ForeColor       =   &H80000008&
  18.    Height          =   5970
  19.    Left            =   855
  20.    LinkTopic       =   "Form1"
  21.    ScaleHeight     =   5565
  22.    ScaleWidth      =   10215
  23.    Top             =   1560
  24.    Width           =   10335
  25.    Begin VB.TextBox txtHost 
  26.       BeginProperty Font 
  27.          name            =   "MS Sans Serif"
  28.          charset         =   0
  29.          weight          =   400
  30.          size            =   8.25
  31.          underline       =   0   'False
  32.          italic          =   0   'False
  33.          strikethrough   =   0   'False
  34.       EndProperty
  35.       Height          =   285
  36.       Left            =   2640
  37.       TabIndex        =   1
  38.       Top             =   480
  39.       Width           =   2175
  40.    End
  41.    Begin VB.CheckBox chkVerbose 
  42.       Alignment       =   1  'Right Justify
  43.       Caption         =   "Verbose Query"
  44.       BeginProperty Font 
  45.          name            =   "MS Sans Serif"
  46.          charset         =   0
  47.          weight          =   400
  48.          size            =   8.25
  49.          underline       =   0   'False
  50.          italic          =   0   'False
  51.          strikethrough   =   0   'False
  52.       EndProperty
  53.       Height          =   255
  54.       Left            =   5520
  55.       TabIndex        =   2
  56.       Top             =   480
  57.       Width           =   1575
  58.    End
  59.    Begin VB.TextBox txtQueryResults 
  60.       BeginProperty Font 
  61.          name            =   "Courier New"
  62.          charset         =   0
  63.          weight          =   400
  64.          size            =   8.25
  65.          underline       =   0   'False
  66.          italic          =   0   'False
  67.          strikethrough   =   0   'False
  68.       EndProperty
  69.       Height          =   3255
  70.       Left            =   240
  71.       MultiLine       =   -1  'True
  72.       ScrollBars      =   2  'Vertical
  73.       TabIndex        =   4
  74.       Top             =   2040
  75.       Width           =   6855
  76.    End
  77.    Begin VB.TextBox txtQuery 
  78.       BeginProperty Font 
  79.          name            =   "MS Sans Serif"
  80.          charset         =   0
  81.          weight          =   400
  82.          size            =   8.25
  83.          underline       =   0   'False
  84.          italic          =   0   'False
  85.          strikethrough   =   0   'False
  86.       EndProperty
  87.       Height          =   285
  88.       Left            =   240
  89.       TabIndex        =   0
  90.       Top             =   480
  91.       Width           =   2175
  92.    End
  93.    Begin VB.CommandButton cmdFingerQueryNonBlocking 
  94.       Caption         =   "Finger Query (Non-Blocking)"
  95.       BeginProperty Font 
  96.          name            =   "MS Sans Serif"
  97.          charset         =   0
  98.          weight          =   400
  99.          size            =   8.25
  100.          underline       =   0   'False
  101.          italic          =   0   'False
  102.          strikethrough   =   0   'False
  103.       EndProperty
  104.       Height          =   375
  105.       Left            =   7440
  106.       TabIndex        =   5
  107.       Top             =   240
  108.       Width           =   2535
  109.    End
  110.    Begin VB.CommandButton cmdFingerQueryBlocking 
  111.       Caption         =   "Finger Query (Blocking)"
  112.       BeginProperty Font 
  113.          name            =   "MS Sans Serif"
  114.          charset         =   0
  115.          weight          =   400
  116.          size            =   8.25
  117.          underline       =   0   'False
  118.          italic          =   0   'False
  119.          strikethrough   =   0   'False
  120.       EndProperty
  121.       Height          =   375
  122.       Left            =   7440
  123.       TabIndex        =   6
  124.       Top             =   720
  125.       Width           =   2535
  126.    End
  127.    Begin VB.CommandButton cmdExit 
  128.       Caption         =   "Exit Finger Sample"
  129.       BeginProperty Font 
  130.          name            =   "MS Sans Serif"
  131.          charset         =   0
  132.          weight          =   400
  133.          size            =   8.25
  134.          underline       =   0   'False
  135.          italic          =   0   'False
  136.          strikethrough   =   0   'False
  137.       EndProperty
  138.       Height          =   375
  139.       Left            =   7440
  140.       TabIndex        =   7
  141.       Top             =   1320
  142.       Width           =   2535
  143.    End
  144.    Begin FingerLib.Finger Finger1 
  145.       Left            =   9480
  146.       Top             =   4920
  147.       _Version        =   327680
  148.       _ExtentX        =   847
  149.       _ExtentY        =   847
  150.       _StockProps     =   64
  151.       Blocking        =   -1  'True
  152.       Query           =   ""
  153.       Host            =   ""
  154.       Verbose         =   -1  'True
  155.    End
  156.    Begin VB.Label Label6 
  157.       Caption         =   "Host:"
  158.       BeginProperty Font 
  159.          name            =   "MS Sans Serif"
  160.          charset         =   0
  161.          weight          =   400
  162.          size            =   8.25
  163.          underline       =   0   'False
  164.          italic          =   0   'False
  165.          strikethrough   =   0   'False
  166.       EndProperty
  167.       Height          =   255
  168.       Left            =   2640
  169.       TabIndex        =   13
  170.       Top             =   240
  171.       Width           =   1935
  172.    End
  173.    Begin VB.Label Label4 
  174.       Caption         =   "Query Error Code:"
  175.       BeginProperty Font 
  176.          name            =   "MS Sans Serif"
  177.          charset         =   0
  178.          weight          =   400
  179.          size            =   8.25
  180.          underline       =   0   'False
  181.          italic          =   0   'False
  182.          strikethrough   =   0   'False
  183.       EndProperty
  184.       Height          =   215
  185.       Left            =   240
  186.       TabIndex        =   8
  187.       Top             =   1080
  188.       Width           =   1935
  189.    End
  190.    Begin VB.Label Label1 
  191.       Caption         =   "Finger Query:"
  192.       BeginProperty Font 
  193.          name            =   "MS Sans Serif"
  194.          charset         =   0
  195.          weight          =   400
  196.          size            =   8.25
  197.          underline       =   0   'False
  198.          italic          =   0   'False
  199.          strikethrough   =   0   'False
  200.       EndProperty
  201.       Height          =   255
  202.       Left            =   240
  203.       TabIndex        =   9
  204.       Top             =   240
  205.       Width           =   1935
  206.    End
  207.    Begin VB.Label Label2 
  208.       Caption         =   "Query Results:"
  209.       BeginProperty Font 
  210.          name            =   "MS Sans Serif"
  211.          charset         =   0
  212.          weight          =   400
  213.          size            =   8.25
  214.          underline       =   0   'False
  215.          italic          =   0   'False
  216.          strikethrough   =   0   'False
  217.       EndProperty
  218.       Height          =   255
  219.       Left            =   240
  220.       TabIndex        =   10
  221.       Top             =   1800
  222.       Width           =   1935
  223.    End
  224.    Begin VB.Label lblErrorNumber 
  225.       BorderStyle     =   1  'Fixed Single
  226.       BeginProperty Font 
  227.          name            =   "MS Sans Serif"
  228.          charset         =   0
  229.          weight          =   400
  230.          size            =   8.25
  231.          underline       =   0   'False
  232.          italic          =   0   'False
  233.          strikethrough   =   0   'False
  234.       EndProperty
  235.       Height          =   285
  236.       Left            =   240
  237.       TabIndex        =   3
  238.       Top             =   1320
  239.       Width           =   6855
  240.    End
  241.    Begin VB.Label Label3 
  242.       Caption         =   "This sample shows how to retrieve information about a user on a specific host."
  243.       BeginProperty Font 
  244.          name            =   "MS Sans Serif"
  245.          charset         =   0
  246.          weight          =   400
  247.          size            =   8.25
  248.          underline       =   0   'False
  249.          italic          =   0   'False
  250.          strikethrough   =   0   'False
  251.       EndProperty
  252.       Height          =   615
  253.       Left            =   7440
  254.       TabIndex        =   11
  255.       Top             =   2040
  256.       Width           =   2535
  257.    End
  258.    Begin VB.Label Label5 
  259.       Caption         =   $"fingers.frx":0000
  260.       BeginProperty Font 
  261.          name            =   "MS Sans Serif"
  262.          charset         =   0
  263.          weight          =   400
  264.          size            =   8.25
  265.          underline       =   0   'False
  266.          italic          =   0   'False
  267.          strikethrough   =   0   'False
  268.       EndProperty
  269.       Height          =   1215
  270.       Left            =   7440
  271.       TabIndex        =   12
  272.       Top             =   2760
  273.       Width           =   2535
  274.    End
  275. Attribute VB_Name = "frmFinger"
  276. Attribute VB_Creatable = False
  277. Attribute VB_Exposed = False
  278. Option Explicit
  279. Private Sub cmdExit_Click()
  280.     ' Get out.
  281.     End
  282.     End Sub
  283. Private Sub cmdFingerQueryBlocking_Click()
  284.     Dim Index
  285.     ' Clear results boxes.
  286.     txtQueryResults.Text = ""
  287.     lblErrorNumber.Caption = ""
  288.     ' Start the query by getting the IP address
  289.     ' of the InterNIC's Finger server.  When this
  290.     ' is complete, the rest of the query is
  291.     ' handled by the Finger1_Done event
  292.     ' event.
  293.     Finger1.Blocking = True
  294.     Finger1.Host = txtHost
  295.     Finger1.Verbose = chkVerbose
  296.     Finger1.Query = txtQuery.Text
  297.     MousePointer = 11
  298.     Finger1.Action = 1
  299.     MousePointer = 0
  300.     ' Place all of the results into the Query
  301.     ' results text box.
  302.     For Index = 0 To Finger1.ResponseCount - 1
  303.         If Index <> 0 Then
  304.             txtQueryResults.Text = txtQueryResults.Text & Chr(13) & Chr(10)
  305.             End If
  306.         
  307.         txtQueryResults.Text = txtQueryResults.Text & Finger1.Response(Index)
  308.         Next Index
  309.     End Sub
  310. Private Sub cmdFingerQueryNonBlocking_Click()
  311.     ' Clear results boxes.
  312.     txtQueryResults.Text = ""
  313.     lblErrorNumber.Caption = ""
  314.     ' Start the query by getting the IP address
  315.     ' of the InterNIC's Finger server.  When this
  316.     ' is complete, the rest of the query is
  317.     ' handled by the Finger1_Done event
  318.     ' event.
  319.     On Error Resume Next
  320.     Finger1.Blocking = False
  321.     Finger1.Host = txtHost
  322.     Finger1.Verbose = chkVerbose
  323.     Finger1.Query = txtQuery.Text
  324.     MousePointer = 11
  325.     Finger1.Action = 1
  326.     On Error GoTo 0
  327.     End Sub
  328. Private Sub Finger1_Done(ErrorCode As Integer)
  329.     Dim Index
  330.     lblErrorNumber = "Error code: " & ErrorCode
  331.     ' If we handled this in blocking (synchronous)
  332.     ' mode, skip the rest (no need for it).
  333.     If Finger1.Blocking Then
  334.         Exit Sub
  335.         End If
  336.     MousePointer = 0
  337.     ' Place all of the results into the Query
  338.     ' results text box.
  339.     For Index = 0 To Finger1.ResponseCount - 1
  340.         If Index <> 0 Then
  341.             txtQueryResults.Text = txtQueryResults.Text & Chr(13) & Chr(10)
  342.             End If
  343.         
  344.         txtQueryResults.Text = txtQueryResults.Text & Finger1.Response(Index)
  345.         Next Index
  346.     End Sub
  347.